<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Endpoint 0 Service Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__usbfs__dev__hal__functions__ep0__service.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Endpoint 0 Service Functions<div class="ingroups"><a class="el" href="group__group__usbfs__dev__drv.html">USBFS        (USB Full-Speed Device)</a> &raquo; <a class="el" href="group__group__usbfs__dev__drv__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The Endpoint 0 Service functions provide an API to establish communication with the USB Host using control endpoint 0. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac099a76e992ec37a7f0f0dc9b6bee195"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__usbfs__dev__hal__functions__ep0__service.html#gac099a76e992ec37a7f0f0dc9b6bee195">Cy_USBFS_Dev_Drv_Ep0GetSetup</a> (USBFS_Type const *base, uint8_t *buffer, <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> const *context)</td></tr>
<tr class="memdesc:gac099a76e992ec37a7f0f0dc9b6bee195"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the setup packed from the Endpoint 0 hardware buffer.  <a href="#gac099a76e992ec37a7f0f0dc9b6bee195">More...</a><br /></td></tr>
<tr class="separator:gac099a76e992ec37a7f0f0dc9b6bee195"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab15c7a9c63de0a4bc08b498aaac73cec"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__usbfs__dev__hal__functions__ep0__service.html#gab15c7a9c63de0a4bc08b498aaac73cec">Cy_USBFS_Dev_Drv_Ep0Write</a> (USBFS_Type *base, uint8_t const *buffer, uint32_t size, <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> *context)</td></tr>
<tr class="memdesc:gab15c7a9c63de0a4bc08b498aaac73cec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes data into Endpoint 0 hardware buffer and returns how many bytes were written.  <a href="#gab15c7a9c63de0a4bc08b498aaac73cec">More...</a><br /></td></tr>
<tr class="separator:gab15c7a9c63de0a4bc08b498aaac73cec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaef079c2528f49e61f73535f9c4d32fd8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__usbfs__dev__hal__functions__ep0__service.html#gaef079c2528f49e61f73535f9c4d32fd8">Cy_USBFS_Dev_Drv_Ep0Read</a> (USBFS_Type *base, uint8_t *buffer, uint32_t size, <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> *context)</td></tr>
<tr class="memdesc:gaef079c2528f49e61f73535f9c4d32fd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start receiving a packet into the Endpoint 0 hardware buffer.  <a href="#gaef079c2528f49e61f73535f9c4d32fd8">More...</a><br /></td></tr>
<tr class="separator:gaef079c2528f49e61f73535f9c4d32fd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01373022a0ca84da6ad3243a44f0ba85"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__usbfs__dev__hal__functions__ep0__service.html#ga01373022a0ca84da6ad3243a44f0ba85">Cy_USBFS_Dev_Drv_Ep0ReadResult</a> (USBFS_Type const *base, <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> *context)</td></tr>
<tr class="memdesc:ga01373022a0ca84da6ad3243a44f0ba85"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads data from the Endpoint 0 hardware and returns the number of read bytes.  <a href="#ga01373022a0ca84da6ad3243a44f0ba85">More...</a><br /></td></tr>
<tr class="separator:ga01373022a0ca84da6ad3243a44f0ba85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae0fe4cc97a8a9a857289bf721ac66c63"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__usbfs__dev__hal__functions__ep0__service.html#gae0fe4cc97a8a9a857289bf721ac66c63">Cy_USBFS_Dev_Drv_Ep0Stall</a> (USBFS_Type *base)</td></tr>
<tr class="memdesc:gae0fe4cc97a8a9a857289bf721ac66c63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stalls endpoint 0.  <a href="#gae0fe4cc97a8a9a857289bf721ac66c63">More...</a><br /></td></tr>
<tr class="separator:gae0fe4cc97a8a9a857289bf721ac66c63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga53e4e574e7fa85fedcc5c20def955428"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__usbfs__dev__hal__functions__ep0__service.html#ga53e4e574e7fa85fedcc5c20def955428">Cy_USBFS_Dev_Drv_GetEp0MaxPacket</a> (USBFS_Type const *base)</td></tr>
<tr class="memdesc:ga53e4e574e7fa85fedcc5c20def955428"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the endpoint 0 maximum packet size that can be for read or write from the endpoint 0 buffer.  <a href="#ga53e4e574e7fa85fedcc5c20def955428">More...</a><br /></td></tr>
<tr class="separator:ga53e4e574e7fa85fedcc5c20def955428"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gac099a76e992ec37a7f0f0dc9b6bee195"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac099a76e992ec37a7f0f0dc9b6bee195">&#9670;&nbsp;</a></span>Cy_USBFS_Dev_Drv_Ep0GetSetup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_USBFS_Dev_Drv_Ep0GetSetup </td>
          <td>(</td>
          <td class="paramtype">USBFS_Type const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> const *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the setup packed from the Endpoint 0 hardware buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the USBFS instance.</td></tr>
    <tr><td class="paramname">buffer</td><td>The pointer to the buffer for data read from the Endpoint 0.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gab15c7a9c63de0a4bc08b498aaac73cec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab15c7a9c63de0a4bc08b498aaac73cec">&#9670;&nbsp;</a></span>Cy_USBFS_Dev_Drv_Ep0Write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_USBFS_Dev_Drv_Ep0Write </td>
          <td>(</td>
          <td class="paramtype">USBFS_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t const *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes data into Endpoint 0 hardware buffer and returns how many bytes were written. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the USBFS instance.</td></tr>
    <tr><td class="paramname">buffer</td><td>The pointer to the buffer containing data bytes to write. To switch a transfer from the data stage to status, pass NULL as a pointer.</td></tr>
    <tr><td class="paramname">size</td><td>The number of bytes to write. Setting the size to zero sends to the bus zero-length data packet.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes that were written. </dd></dl>

</div>
</div>
<a id="gaef079c2528f49e61f73535f9c4d32fd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaef079c2528f49e61f73535f9c4d32fd8">&#9670;&nbsp;</a></span>Cy_USBFS_Dev_Drv_Ep0Read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_USBFS_Dev_Drv_Ep0Read </td>
          <td>(</td>
          <td class="paramtype">USBFS_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start receiving a packet into the Endpoint 0 hardware buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the USBFS instance.</td></tr>
    <tr><td class="paramname">buffer</td><td>The pointer to buffer that stores data that was read.</td></tr>
    <tr><td class="paramname">size</td><td>The number of bytes to read. Reading zero bytes switch control transfer to status stage.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga01373022a0ca84da6ad3243a44f0ba85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga01373022a0ca84da6ad3243a44f0ba85">&#9670;&nbsp;</a></span>Cy_USBFS_Dev_Drv_Ep0ReadResult()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_USBFS_Dev_Drv_Ep0ReadResult </td>
          <td>(</td>
          <td class="paramtype">USBFS_Type const *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads data from the Endpoint 0 hardware and returns the number of read bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the USBFS instance.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__usbfs__dev__drv__context__t.html">cy_stc_usbfs_dev_drv_context_t</a> allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of read bytes. </dd></dl>

</div>
</div>
<a id="gae0fe4cc97a8a9a857289bf721ac66c63"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae0fe4cc97a8a9a857289bf721ac66c63">&#9670;&nbsp;</a></span>Cy_USBFS_Dev_Drv_Ep0Stall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_USBFS_Dev_Drv_Ep0Stall </td>
          <td>(</td>
          <td class="paramtype">USBFS_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stalls endpoint 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the USBFS instance. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga53e4e574e7fa85fedcc5c20def955428"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga53e4e574e7fa85fedcc5c20def955428">&#9670;&nbsp;</a></span>Cy_USBFS_Dev_Drv_GetEp0MaxPacket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_USBFS_Dev_Drv_GetEp0MaxPacket </td>
          <td>(</td>
          <td class="paramtype">USBFS_Type const *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the endpoint 0 maximum packet size that can be for read or write from the endpoint 0 buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the USBFS instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The endpoint 0 maximum packet size (endpoint 0 has a dedicated hardware buffer). </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
